package com.ruoyi.constant.v3;

/**
 * 月份枚举
 *
 * @author: Gao Tianle
 * @date: 2024-04-23 14:59
 **/
public enum MonthV3Enum {

    JANUARY(1, "一月"),
    FEBRUARY(2, "二月"),
    MARCH(3, "三月"),
    APRIL(4, "四月"),
    MAY(5, "五月"),
    JUNE(6, "六月"),
    JULY(7, "七月"),
    AUGUST(8, "八月"),
    SEPTEMBER(9, "九月"),
    OCTOBER(10, "十月"),
    NOVEMBER(11, "十一月"),
    DECEMBER(12, "十二月");

    private Integer code;
    private String desc;

    MonthV3Enum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByCode(Integer code) {
        for (MonthV3Enum value : MonthV3Enum.values()) {
            if (value.getCode().equals(code)) {
                return value.getDesc();
            }
        }
        return "";
    }
}
